<HTML><H1>Stasis Version 1.10 SWI Documentation</H1>

Stasis supports an SWI block based at &amp;47D40.

	<a href="#load">Stasis_Load</a>
	<a href="#save">Stasis_Save</a>
	<a href="#link">Stasis_Link</a>
	<a href="#attach">Stasis_Attach</a>
	<a href="#name">Stasis_Name</a>
	<a href="#volslide">Stasis_VolSlide</a>
	<a href="#pitchslide">Stasis_PitchSlide</a>
	<a href="#slide">Stasis_Slide</a>
	<a href="#control">Stasis_Control</a>
	<a href="#finetune">Stasis_FineTune</a>
	<a href="#sound">Stasis_Sound</a>
	<a href="#GetSlotInfo">Stasis_GetSlotInfo</a>
	<a href="#PutSlotInfo">Stasis_PutSlotInfo</a>
	
<a name="load"><H1>Stasis_Load</H1></a>

Loads a sample from a file.

On Entry

R0 = slot
R1 = filename
R2 = type

On Exit

R1,R2 preserved

Interrupt status is unaltered.  SWI is not re-entrant.

Use

This SWI will load a sample from a file into memory.  If R2=3 the sample is
loaded into the Amnesia area, otherwise it is loaded into the RMA.

<a name="save"><H1>Stasis_Save</H1></a>

Save a sample from a file.

On Entry

R0 = slot
R1 = filename
R2 = type string

On Exit

R1,R2 preserved

Interrupt status is unaltered.  SWI is not re-entrant.

Use

This SWI will save a sample to a file.  R2 points to a type string such as
"Stasis" or "DataVox".  If R2=0 then stasis native format is assumed.  The
sample is then packaged into the specified format and saved.

<a name="link"><H1>Stasis_Link</H1></a>

Attaches a sound channel to sample.

On Entry

R0 = channel
R1 = slot

On Exit

R1 preserved

Interrupt status is unaltered.  SWI is re-entrant.

Use

This SWI will update the Stasis link table so that any new sounds will use
the sample in the specified slot.  Samples currently playing will not be
affected.  Note that unlike the *StasisLink command this SWI will not attach
the channel to the Stasis voice.  You must either use a *StasisLink command
at least once before using this SWI, or attach the voice yourself using the
*ChannelVoice command or Stasis_Attach.

<a name="attach"><H1>Stasis_Attach</H1></a>

Attaches a sound channel to the Stasis module.

On Entry

R0 = channel

On Exit

R0 corrupted

Interrupt status is unaltered.  SWI is not re-entrant.

Use

This attaches a channel to the Stasis module, like *Channelvoice 1 Stasis
would.

<a name="name"><H1>Stasis_Name</H1></a>

Changes the name of a sample

On Entry

R0 = slot
R1 = pointer to name string

On Exit

R1 preserved

Interrupt status is unaltered.  SWI is not re-entrant.

Use

This changes the name of a sample - the name that is help in the sample
header.  If the sample format does not include space for a name, this SWI has
no effect.

<a name="volslide"><H1>Stasis_VolSlide</H1></a>

Sets a volume slide

On Entry

R0 = channel
R1 = target volume (0-&amp;7F)
R2 = time (in centiseconds)

On Exit

R1,R2 preserved

Interrupt status is unaltered.  SWI is re-entrant.

Use

This SWI sets up a volume slide on the specified channel.  The volume will
increase or decrease, as necessary, so that the target volume is reached in
the specified time.  R2=0 is valid, but R2=1 is a more sensible way of
achieving the same thing.  Both with adjust the volume to R1 immediately.

<a name="pitchslide"><H1>Stasis_PitchSlide</H1></a>

Sets a pitch slide

On Entry

R0 = channel
R1 = target pitch ( > &amp;1000)
R2 = time (in buffer fills)

On Exit

R1,R2 preserved

Interrupt status is unaltered.  SWI is re-entrant.

Use

This SWI sets up a pitch slide on the specified channel.  Its action is
similar to Stasis_VolSlide.

<a name="slide"><H1>Stasis_Slide</H1></a>

Sets a slide of the specified type

On Entry

R0 = channel
R1 = type
R2 = target volume or pitch
R3 = time (in buffer fills)

On Exit

R1-R3 preserved

Interrupt status is unaltered.  SWI is re-entrant.

Use

This is the preferred way of setting slides.  If R1=0 a volume slide is set. 
If R1=1, a pitch slide.  The bits in R0 have the following effect:

bit 31  : do not write the target pitch to the control block.
bit 30  : do not write the rate.
bit 29  : treat R3 as a rate, not a time.  R3 will be added to the volume or
pitch on each buffer fill.
bit 28  : if this is a pitch slide R2 will not be passed through Sound_Pitch
before writing.

<a name="control"><H1>Stasis_Control</H1></a>

Does nothing - retained for past compatibility

<a name="finetune"><H1>Stasis_FineTune</H1></a>

Sets the finetune value for a sample

On Entry

R0 = slot
R1 = finetune

On Exit

R1 preserved

Interrupt status is unaltered.  SWI is re-entrant.

Use

Sets the finetune value for a sample.  The default value is &amp;4000.  A value
of &amp;8000 will play the sample an octave higher, and a value of &amp;2000 will
play it an octave lower.

<a name="sound"><H1>Stasis_Sound</H1></a>

Makes a sound

On Entry

R0 = channel
R1 = slot
R2 = volume
R3 = pitch
R4 = the ignore value

On Exit

R1-R3 preserved

Interrupt status is unaltered.  SWI is re-entrant.

Use

This command is analagous to Sound_Control.  The difference is that you
specify a sample slot to play, and the pitch must be specified in the > &amp;1000
form.  The volume should be specified as 0-&amp;7F.

The bits in R4 have the following effect.

bit 0  : ignore the slot
bit 1  : ignore the volume
bit 2  : ignore the pitch
bit 3  : update - do not alter the channel flags
bit 4  : do not pass the pitch through Sound_Pitch
bit 5  : silence the sound - used internally when an escape is handled

These bits may be set to provide updates.  For example, Stasis_Volume calls
this SWI with bit 0,2 and 3 set.

<a name="getslotinfo"><H1>Stasis_GetSlotInfo</H1></a>

Return information on the sample in a slot

On Entry

R0 = slot

On Exit

R0 preserved
R1 = pointer to name string
R2 = sample length
R2 = sample length
R3 = finetune value
R4 = repeat offset
R5 = repeat length
R6 = address of sample data
R7 = sample volume entry
R8 = 0 (for future expansion)

Interrupt status is unaltered.  SWI is re-entrant.

Use

This sample returns information on a sample.  If items such as finetune or
volume are missing from tha sample format then 0 will be returned in that
register.  

<a name="putslotinfo"><H1>Stasis_PutSlotInfo</H1></a>

Updates various details of a sample in a slot

On Entry

R0 = slot
R1 = pointer to name string
R2 = sample length
R2 = sample length
R3 = finetune value
R4 = repeat offset
R5 = repeat length
R6 = address of sample data
R7 = sample volume entry
R8 = flag field

Interrupt status is unaltered.  SWI is not re-entrant.

Use

This SWI updates the details of a sample.  Values may or may not be written
depending on the value of R8.  If bit 1 is set, R1 will be written. If bit 2
is set R2 will be written and so on.  If the sample format does not support
the details you are trying to write an error will be returned.  The error
returning method here is slightly flawed, as is calls OS_WriteS of its own
accord.

------------------------------

This file updated 15/8/94 and 7/8/95 by A.Southgate.
